Performance Optimization Tips¶
Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.
Available Performance Tools¶
Tool |
Purpose |
Example Command |
|---|---|---|
|
View real-time process, CPU, and memory usage. |
|
|
View processes sorted by CPU or memory usage. |
|
|
View uptime and system load. |
|
|
View overall CPU utilization. |
|
|
View rough CPU, memory, swap, and I/O status. |
|
|
View memory and swap usage. |
|
|
View block device I/O statistics. |
|
|
View filesystem space usage. |
|
|
View directory space usage. |
|
|
View CPU architecture and frequency information. |
|
|
View block devices and mount relationships. |
|
|
View kernel parameters. |
|
|
View service status. |
|
|
View service or system logs. |
|
|
Basic network connectivity test. |
|
System Performance Monitoring¶
View Overall Load¶
Use uptime first to view system uptime and load average:
adb shell 'uptime'
The sample output contains load average. If the load average remains significantly higher than the CPU core count for a long time, further check CPU, I/O, or process usage.
View Process CPU and Memory Usage¶
Use top to view current system processes, CPU, and memory overview:
adb shell 'top -b -n 1 | head -20'
To quickly locate processes with high CPU usage, use:
adb shell 'ps -eo pid,ppid,comm,%cpu,%mem,args --sort=-%cpu | head -12'
To sort by memory usage, use:
adb shell 'ps -eo pid,ppid,comm,%cpu,%mem,args --sort=-%mem | head -12'
View CPU Utilization¶
mpstat can observe the proportions of user mode, kernel mode, I/O wait, and idle CPU time:
adb shell 'mpstat 1 2'
In this test, mpstat ran normally. The average idle ratio in the example was about 92% or higher, indicating that overall CPU pressure was not high during the test.
View CPU Frequency and Scheduling Policy¶
CPU0-7 are currently online on the development board. View them with:
adb shell 'cat /sys/devices/system/cpu/online'
View the current CPU governor:
adb shell 'for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do [ -e "$f" ] && printf "%s=" "$f" && cat "$f"; done'
The governors of CPU0-7 are all performance. Available governors include userspace, ondemand, walt, conservative, powersave, performance, and schedutil.
View the current frequency:
adb shell 'for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq; do [ -e "$f" ] && printf "%s=" "$f" && cat "$f"; done'
In this test, CPU0-3 were about 1804800 kHz, and CPU4-7 were about 2016000 kHz.
Memory and Swap Monitoring¶
View Memory Usage¶
Use free to view memory, cache, and swap usage:
adb shell 'free -h'
In this test, total system memory was about 3.5 GiB, available memory was about 2.4 GiB, and swap was about 1.8 GiB with no obvious usage.
View vmstat¶
vmstat can quickly observe run queue, memory, swap, I/O, and CPU usage:
adb shell 'vmstat 1 2'
Focus on:
r: run queue. If it remains high, the CPU may be busy.si/so: swap in/out. Continuous non-zero values indicate high memory pressure.wa: I/O wait. Continuous high values indicate that storage I/O may be a bottleneck.id: CPU idle. Continuous low values indicate high CPU utilization.
View zram swap¶
The current system uses /dev/zram0 as swap. View it with:
adb shell 'cat /proc/swaps; zramctl 2>/dev/null || true'
In this test, /dev/zram0 was about 1.8 GiB, priority was 32758, and it was almost unused.
Storage I/O and Space Check¶
View Filesystem Space¶
Use df to view space usage of each mount point:
adb shell 'df -h'
In this test, the root filesystem / was about 7.8 GiB with about 4.1 GiB used; /data was about 40 GiB with sufficient remaining space. Large logs, test files, and temporary data should preferably be placed under /data or /tmp to avoid filling the root filesystem.
View Directory Usage¶
To locate large files or directories, use:
adb shell 'du -sh /data/* 2>/dev/null | sort -h | tail -20'
If checking root filesystem space, change the target to directories such as /var, /usr, and /opt.
View Block Devices¶
Use lsblk to view block devices, partitions, and mount points:
adb shell 'lsblk'
The main storage device is currently mmcblk0; system, cache, and data partitions are mounted from different partitions of this block device.
View I/O Statistics¶
The iostat on the current development board is the BusyBox version and does not support the -x extended option. Use the following command to view basic block device I/O:
adb shell 'iostat -d -k 1 2'
To observe CPU and I/O status together, combine it with vmstat 1 2.
Network Status Check¶
The current development board can use ip and ping for basic network checks:
adb shell 'ip -br addr; ip route'
In this test, wlan0 and p2p0 were DOWN, and no default route was found. Therefore, external network throughput or bandwidth test procedures are not suitable for this document at present.
Local loopback connectivity can be verified with:
adb shell 'ping -c 3 -W 1 127.0.0.1'
In this test, the loopback ping test had 0% packet loss, which can be used to confirm that the basic network stack works normally.
Service and Log Troubleshooting¶
View Failed Services¶
Service exceptions may affect boot speed, background resource usage, and functional stability. First view failed services:
adb shell 'systemctl --failed --no-pager'
In this test, several failed services existed, such as camera_cgroup.service, lefbe.service, pulseaudio.service, qwesd.service, and thermal-engine.service. Whether they need to be optimized or disabled should be judged according to the corresponding functional requirements.
View Error Logs¶
View recent error logs:
adb shell 'journalctl -p err -n 50 --no-pager'
To view logs of a specific service, use:
adb shell 'journalctl -u SERVICE_NAME --no-pager -n 100'
When troubleshooting service-related performance problems, first confirm whether services are repeatedly restarting, blocking startup, or continuously printing error logs.
View Kernel Parameters¶
The current system can use sysctl to view some kernel parameters:
adb shell 'sysctl kernel.kptr_restrict kernel.perf_event_paranoid vm.swappiness vm.dirty_ratio vm.dirty_background_ratio net.core.rmem_max net.core.wmem_max'
Measured values in this test include:
kernel.kptr_restrict = 2kernel.perf_event_paranoid = 2vm.swappiness = 100vm.dirty_ratio = 20vm.dirty_background_ratio = 10net.core.rmem_max = 1048576net.core.wmem_max = 1048576
Changing kernel parameters affects system behavior. Before making formal changes, evaluate the specific issue and keep the original values for rollback.
Process Priority and CPU Affinity¶
The current system can use nice, renice, ionice, and taskset. These tools are suitable for temporarily adjusting process priority or CPU affinity during debugging.
Check Whether Commands Exist¶
adb shell 'command -v taskset; command -v nice; command -v renice; command -v ionice'
Example: Run a Command on Specified CPUs¶
adb shell 'taskset -c 0-3 COMMAND'
Example: Adjust Process Priority¶
adb shell 'renice -n 5 -p PROCESS_PID'
These commands change process scheduling behavior. Use them only when the target process and test purpose are clear.
Temperature Status View¶
Thermal sysfs can be used to view temperatures of each thermal zone:
adb shell 'for z in /sys/class/thermal/thermal_zone*; do [ -e "$z/type" ] && printf "%s " "$(cat "$z/type")" && cat "$z/temp" 2>/dev/null; done | head -40'
In this test, thermal zones such as cpu-1-0, cpu-1-1, cpu-1-2, gpu, wlan, and video could be read. Temperature values are usually shown in millidegrees Celsius; for example, 50800 means about 50.8°C.
Optimization Troubleshooting Flow¶
Run
uptimeandtop -b -n 1first to determine whether the system is generally busy.If CPU usage is high, use
ps --sort=-%cpuandmpstatto locate the process and CPU utilization.If memory is tight, use
free -h,vmstat 1 2, andcat /proc/swapsto view available memory, swap, and zram status.If the system is sluggish but CPU usage is not high, use
vmstatandiostat -d -k 1 2to check for I/O wait or storage access pressure.If boot is slow or background services are abnormal, use
systemctl --failedandjournalctl -p errto view failed services and error logs.If overheating or frequency throttling is suspected, check
scaling_cur_freq,scaling_governor, and thermal zone temperatures.If a network issue is involved, confirm
ip -br addrandip routefirst, then run connectivity tests.
Notes¶
This document only keeps tools and commands verified as available on the current development board.
Tools such as
perf,htop,sar,pidstat,stress-ng, andsysbenchare not included in the current workflow.The current
iperf3command has a missing dependency library issue, so it is not included in this network throughput test workflow.When operating governor, sysctl, renice, ionice, or service start/stop settings, clarify the test purpose first and record the state before modification.
For formal optimization, change only one variable at a time and record
top,vmstat,mpstat,iostat,journalctl, and other results before and after the change, to avoid being unable to determine which change produced the effect.
Summary¶
The current development board can use basic Linux tools to troubleshoot CPU, memory, storage, services, logs, temperature, and basic network status. During performance optimization, first use read-only commands to identify the bottleneck source, then narrow down the issue by CPU, memory, I/O, services, logs, and temperature. Tools that are currently unavailable or have incomplete dependencies should not be added directly to regular operating procedures.